using System;
using System.Collections.Generic;
using System.Dynamic;
using RimWorld;
using UnityEngine;
using Verse;

namespace RimZombieGirl
{
    // 参考 Alert_TatteredApparel
    public class ZombieSuppressAlert : Alert
    {


        // Token: 0x0601153E RID: 70974 RVA: 0x004F6786 File Offset: 0x004F4986
        public ZombieSuppressAlert()
        {
            this.defaultLabel = "RI_Alert_ZombieNeedSuppress".Translate();
            this.defaultExplanation = "RI_Alert_ZombieNeedSuppressDesc".Translate();
            this.defaultPriority = AlertPriority.High;
        }

        protected override Color BGColor
        {
            get
            {
                return Color.red;
            }
        }

        public override AlertReport GetReport()
        {
            List<Pawn> zombiesNeedSuppress = new List<Pawn>();
            foreach (Pawn pawn in DeadNotDeadCache.cache.Keys)
            {
                if (pawn.Dead)
                {
                    continue;
                }
                Need_Zombie_Suppress need = pawn?.needs?.TryGetNeed<Need_Zombie_Suppress>();
                if (need != null && need.ShouldSuppress)
                {
                    zombiesNeedSuppress.Add(pawn);
                }

            }
            if (zombiesNeedSuppress.Count == 0)
            {
                return false;
            }
            return AlertReport.CulpritsAre(zombiesNeedSuppress);
        }
    }
}